﻿using AIO.IService.Base;
using Microsoft.AspNetCore.Mvc;

namespace AIO.Api.Controller
{
    [Route("api/[controller]")]
    [ApiController]
    public class ClassroomController : ControllerBase
    {
        /// <summary>
        /// 仓储
        /// </summary>
        private readonly IRepositoryWrapper _repository;
        /// <summary>
        /// 日志
        /// </summary>
        private readonly ILogger<ClassroomController> _logger;

        public ClassroomController(IRepositoryWrapper repository
            , ILogger<ClassroomController> logger)
        {
            _repository = repository;
            _logger = logger;
        }
        [HttpGet]
        public IActionResult GetAll()
        {
            try
            {
                var list = _repository.ClassroomRepository.GetAllNoBy();
                return Ok(list);
            }
            catch (Exception ex)
            {
                return StatusCode(500);
            }

        }
    }
}
